﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using RobotOM;

namespace BarBarClosestNodesAddin
{
    [System.Runtime.InteropServices.ComVisibleAttribute(true), System.Runtime.InteropServices.Guid("1658EFA3-3082-46DE-8877-A78287614397")]
    public class BarBarClosestNodes : IRobotAddIn
    {
        private IRobotApplication iapp = null;

        public bool Connect(RobotApplication robot_app, int add_in_id, bool first_time)
        {
            iapp = robot_app;
            return true;
        }

        public bool Disconnect()
        {
            iapp = null;
            return true;
        }

        public void DoCommand(int cmd_id)
        {
            MainForm form1 = new MainForm();
            form1.RobotApp = iapp;
            form1.Show();
        }

        public double GetExpectedVersion()
        {
            return 10;
        }

        public int InstallCommands(RobotCmdList cmd_list)
        {
            cmd_list.New(1, "Bar-bar closest point"); // Text in Robot menu
            return cmd_list.Count;
        }
    }


    //static class Program
    //{
    //    /// <summary>
    //    /// Главная точка входа для приложения.
    //    /// </summary>
    //    [STAThread]
    //    static void Main()
    //    {
    //        Application.EnableVisualStyles();
    //        Application.SetCompatibleTextRenderingDefault(false);
    //        Application.Run(new MainForm());
    //    }
    //}
}
